package basic.com.liz.learn.design.factory;

public class SenderFactory
{
    public Sender produce(String type)
    {
        if ("mail".equals(type))
        {
            return new MailSender();
        }
        else if ("sms".equals(type))
        {
            return new SmsSender();
        }
        else
        {
            System.out.println("出错了!");
            return null;
        }
    }
}
